<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: aruntime/src/main/java/nars/entity/TaskLink.java Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d3/dce/TaskLink_8java_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">TaskLink.java</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../d3/dce/TaskLink_8java.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * TaskLink.java</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2008  Pei Wang</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * This file is part of Open-NARS.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * Open-NARS is free software; you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * the Free Software Foundation, either version 2 of the License, or</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * Open-NARS is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * along with Open-NARS.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">package </span>nars.entity;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">import</span> <a class="code" href="../../d7/d81/namespacenars.html">nars</a>.<a class="code" href="../../d0/d72/namespacenars_1_1language.html">language</a>.<a class="code" href="../../d8/db8/classnars_1_1language_1_1Term.html">Term</a>;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">import</span> <a class="code" href="../../d7/d81/namespacenars.html">nars</a>.<a class="code" href="../../de/ddc/namespacenars_1_1storage.html">storage</a>.<a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink.html">   32</a></span>&#160;<span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink.html">TaskLink</a> <span class="keyword">extends</span> <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">TermLink</a> {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3.html#a9b179154838fa2fea5e163b8aacee9a3">   35</a></span>&#160;    <span class="keyword">private</span> <a class="code" href="../../dc/ddc/classnars_1_1entity_1_1Task.html">Task</a> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3.html#a9b179154838fa2fea5e163b8aacee9a3">targetTask</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67.html#ab09ee26890f38c3e532da7bac1d5cc67">   37</a></span>&#160;    <span class="keyword">private</span> String <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67.html#ab09ee26890f38c3e532da7bac1d5cc67">recordedLinks</a>[];</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">   39</a></span>&#160;    <span class="keyword">private</span> <span class="keywordtype">long</span> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">recordingTime</a>[];</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9.html#a625a62924f39fbcaad6b5e2a799393d9">   41</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9.html#a625a62924f39fbcaad6b5e2a799393d9">counter</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a0ce4b9418566a6c3f28daf3c8eaad2de.html#a0ce4b9418566a6c3f28daf3c8eaad2de">   51</a></span>&#160;    <span class="keyword">public</span> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a0ce4b9418566a6c3f28daf3c8eaad2de.html#a0ce4b9418566a6c3f28daf3c8eaad2de">TaskLink</a>(<a class="code" href="../../dc/ddc/classnars_1_1entity_1_1Task.html">Task</a> t, <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">TermLink</a> <span class="keyword">template</span>, <a class="code" href="../../db/d8e/classnars_1_1entity_1_1BudgetValue.html">BudgetValue</a> v) {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        super(<span class="stringliteral">&quot;&quot;</span>, v);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        targetTask = t;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">template</span> == null) {</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48.html#a83725fe12a973c0181d3143ed4622f48">type</a> = <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">TermLink</a>.<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_abc9e35e4d0450f422fc03e2e53394e6a.html#abc9e35e4d0450f422fc03e2e53394e6a">SELF</a>;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">index</a> = null;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48.html#a83725fe12a973c0181d3143ed4622f48">type</a> = <span class="keyword">template</span>.getType();</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">index</a> = <span class="keyword">template</span>.getIndices();</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        recordedLinks = <span class="keyword">new</span> String[<a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">TERM_LINK_RECORD_LENGTH</a>];</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        recordingTime = <span class="keyword">new</span> <span class="keywordtype">long</span>[<a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">TERM_LINK_RECORD_LENGTH</a>];</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        counter = 0;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_ad19e927a3e2e339682081d8e462fe73b.html#ad19e927a3e2e339682081d8e462fe73b">setKey</a>();   <span class="comment">// as defined in TermLink</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <a class="code" href="../../d1/dd1/classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600.html#a1487af4a10f874c370c913d9ef784600">key</a> += t.<a class="code" href="../../d1/dd1/classnars_1_1entity_1_1Item_ab5c9fbb171f325844966b496010acf60.html#ab5c9fbb171f325844966b496010acf60">getKey</a>();</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a60ac6941518e78c1f0049b90437b9053.html#a60ac6941518e78c1f0049b90437b9053">   72</a></span>&#160;    <span class="keyword">public</span> <a class="code" href="../../dc/ddc/classnars_1_1entity_1_1Task.html">Task</a> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a60ac6941518e78c1f0049b90437b9053.html#a60ac6941518e78c1f0049b90437b9053">getTargetTask</a>() {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3.html#a9b179154838fa2fea5e163b8aacee9a3">targetTask</a>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f.html#afea026df0afd74986f940d10a7875a2f">   85</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">boolean</span> <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f.html#afea026df0afd74986f940d10a7875a2f">novel</a>(<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">TermLink</a> termLink, <span class="keywordtype">long</span> currentTime) {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <a class="code" href="../../d8/db8/classnars_1_1language_1_1Term.html">Term</a> bTerm = termLink.<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a133e3243292f9daacaa8443acef6b185.html#a133e3243292f9daacaa8443acef6b185">getTarget</a>();</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">if</span> (bTerm.<a class="code" href="../../d8/db8/classnars_1_1language_1_1Term_ad85f45a7858737445d5158801774ff5f.html#ad85f45a7858737445d5158801774ff5f">equals</a>(targetTask.<a class="code" href="../../dc/ddc/classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f.html#ab140cb553a6cf40b07093d1df283567f">getSentence</a>().<a class="code" href="../../d6/d25/classnars_1_1entity_1_1Sentence_ad1ded9a02cae3557948d05530cd4d37e.html#ad1ded9a02cae3557948d05530cd4d37e">getContent</a>())) {</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        String linkKey = termLink.<a class="code" href="../../d1/dd1/classnars_1_1entity_1_1Item_ab5c9fbb171f325844966b496010acf60.html#ab5c9fbb171f325844966b496010acf60">getKey</a>();</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keywordtype">int</span> next = 0;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keywordtype">int</span> i;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9.html#a625a62924f39fbcaad6b5e2a799393d9">counter</a>; i++) {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            next = i % <a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">TERM_LINK_RECORD_LENGTH</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            <span class="keywordflow">if</span> (linkKey.equals(recordedLinks[next])) {</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                <span class="keywordflow">if</span> (currentTime &lt; recordingTime[next] + <a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">TERM_LINK_RECORD_LENGTH</a>) {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                    recordingTime[next] = currentTime;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                }</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;            }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        next = i % <a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">TERM_LINK_RECORD_LENGTH</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        recordedLinks[next] = linkKey;       <span class="comment">// add knowledge reference to recordedLinks</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        recordingTime[next] = currentTime;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">if</span> (counter &lt; <a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">TERM_LINK_RECORD_LENGTH</a>) { <span class="comment">// keep a constant length</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            counter++;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    }</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    @Override</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ae9f2d682898024ac0c358b50161b48d0.html#ae9f2d682898024ac0c358b50161b48d0">  115</a></span>&#160;    <span class="keyword">public</span> String <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ae9f2d682898024ac0c358b50161b48d0.html#ae9f2d682898024ac0c358b50161b48d0">toString</a>() {</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">return</span> super.toString() + <span class="stringliteral">&quot; &quot;</span> + <a class="code" href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a60ac6941518e78c1f0049b90437b9053.html#a60ac6941518e78c1f0049b90437b9053">getTargetTask</a>().<a class="code" href="../../dc/ddc/classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f.html#ab140cb553a6cf40b07093d1df283567f">getSentence</a>().<a class="code" href="../../d6/d25/classnars_1_1entity_1_1Sentence_ac0ed749c50e55120d5b63219ed7eb082.html#ac0ed749c50e55120d5b63219ed7eb082">getStamp</a>();</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    }</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment">//    /**</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment">//     * Merge one TaskLink into another</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">//     * @param that The other TaskLink</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment">//     */</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="comment">//    @Override</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="comment">//    public void merge(Item that) {</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment">//        if (targetTask.getCreationTime() &gt; ((TaskLink) that).getTargetTask().getCreationTime()) {</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">//            super.merge(that);</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="comment">//        } else {</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="comment">//            ((Item) that).merge(this);</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="comment">//        }</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="comment">//    }</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;}</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_a133e3243292f9daacaa8443acef6b185_html_a133e3243292f9daacaa8443acef6b185"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a133e3243292f9daacaa8443acef6b185.html#a133e3243292f9daacaa8443acef6b185">nars.entity.TermLink.getTarget</a></div><div class="ttdeci">Term getTarget()</div><div class="ttdoc">Get the target of the link. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00143">TermLink.java:143</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891_html_a8219e84e2e88420ef548f493bafa6891"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a8219e84e2e88420ef548f493bafa6891.html#a8219e84e2e88420ef548f493bafa6891">nars.entity.TaskLink.recordingTime</a></div><div class="ttdeci">long recordingTime[]</div><div class="ttdoc">Remember the time when each TermLink is used with this TaskLink. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00039">TaskLink.java:39</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f_html_afea026df0afd74986f940d10a7875a2f"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_afea026df0afd74986f940d10a7875a2f.html#afea026df0afd74986f940d10a7875a2f">nars.entity.TaskLink.novel</a></div><div class="ttdeci">boolean novel(TermLink termLink, long currentTime)</div><div class="ttdoc">To check whether a TaskLink should use a TermLink, return false if they interacted recently...</div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00085">TaskLink.java:85</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a0ce4b9418566a6c3f28daf3c8eaad2de_html_a0ce4b9418566a6c3f28daf3c8eaad2de"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a0ce4b9418566a6c3f28daf3c8eaad2de.html#a0ce4b9418566a6c3f28daf3c8eaad2de">nars.entity.TaskLink.TaskLink</a></div><div class="ttdeci">TaskLink(Task t, TermLink template, BudgetValue v)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00051">TaskLink.java:51</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_html"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">nars.entity.TermLink</a></div><div class="ttdoc">A link between a compound term and a component term. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00038">TermLink.java:38</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_html"><div class="ttname"><a href="../../d8/df4/classnars_1_1storage_1_1Memory.html">nars.storage.Memory</a></div><div class="ttdoc">The memory of the system. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l00051">Memory.java:51</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_1_1Parameters_html"><div class="ttname"><a href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">nars.storage.Memory.Parameters</a></div><div class="ttdoc">Collected system parameters. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l01069">Memory.java:1069</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Sentence_ac0ed749c50e55120d5b63219ed7eb082_html_ac0ed749c50e55120d5b63219ed7eb082"><div class="ttname"><a href="../../d6/d25/classnars_1_1entity_1_1Sentence_ac0ed749c50e55120d5b63219ed7eb082.html#ac0ed749c50e55120d5b63219ed7eb082">nars.entity.Sentence.getStamp</a></div><div class="ttdeci">Stamp getStamp()</div><div class="ttdoc">Get the stamp of the sentence. </div><div class="ttdef"><b>Definition:</b> <a href="../../da/d1c/Sentence_8java_source.html#l00173">Sentence.java:173</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Task_html"><div class="ttname"><a href="../../dc/ddc/classnars_1_1entity_1_1Task.html">nars.entity.Task</a></div><div class="ttdoc">A task to be processed, consists of a Sentence and a BudgetValue. </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/d10/Task_8java_source.html#l00035">Task.java:35</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f_html_ab140cb553a6cf40b07093d1df283567f"><div class="ttname"><a href="../../dc/ddc/classnars_1_1entity_1_1Task_ab140cb553a6cf40b07093d1df283567f.html#ab140cb553a6cf40b07093d1df283567f">nars.entity.Task.getSentence</a></div><div class="ttdeci">Sentence getSentence()</div><div class="ttdoc">Get the sentence. </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/d10/Task_8java_source.html#l00099">Task.java:99</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67_html_ab09ee26890f38c3e532da7bac1d5cc67"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ab09ee26890f38c3e532da7bac1d5cc67.html#ab09ee26890f38c3e532da7bac1d5cc67">nars.entity.TaskLink.recordedLinks</a></div><div class="ttdeci">String recordedLinks[]</div><div class="ttdoc">Remember the TermLinks that has been used recently with this TaskLink. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00037">TaskLink.java:37</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Sentence_ad1ded9a02cae3557948d05530cd4d37e_html_ad1ded9a02cae3557948d05530cd4d37e"><div class="ttname"><a href="../../d6/d25/classnars_1_1entity_1_1Sentence_ad1ded9a02cae3557948d05530cd4d37e.html#ad1ded9a02cae3557948d05530cd4d37e">nars.entity.Sentence.getContent</a></div><div class="ttdeci">Term getContent()</div><div class="ttdoc">Get the content of the sentence. </div><div class="ttdef"><b>Definition:</b> <a href="../../da/d1c/Sentence_8java_source.html#l00133">Sentence.java:133</a></div></div>
<div class="ttc" id="namespacenars_1_1storage_html"><div class="ttname"><a href="../../de/ddc/namespacenars_1_1storage.html">nars.storage</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d6/dce/Bag_8java_source.html#l00021">Bag.java:21</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9_html_a625a62924f39fbcaad6b5e2a799393d9"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a625a62924f39fbcaad6b5e2a799393d9.html#a625a62924f39fbcaad6b5e2a799393d9">nars.entity.TaskLink.counter</a></div><div class="ttdeci">int counter</div><div class="ttdoc">The number of TermLinks remembered. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00041">TaskLink.java:41</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600_html_a1487af4a10f874c370c913d9ef784600"><div class="ttname"><a href="../../d1/dd1/classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600.html#a1487af4a10f874c370c913d9ef784600">nars.entity.Item.key</a></div><div class="ttdeci">String key</div><div class="ttdoc">The key of the Item, unique in a Bag. </div><div class="ttdef"><b>Definition:</b> <a href="../../d9/de0/Item_8java_source.html#l00034">Item.java:34</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3_html_a9b179154838fa2fea5e163b8aacee9a3"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a9b179154838fa2fea5e163b8aacee9a3.html#a9b179154838fa2fea5e163b8aacee9a3">nars.entity.TaskLink.targetTask</a></div><div class="ttdeci">Task targetTask</div><div class="ttdoc">The Task linked. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00035">TaskLink.java:35</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_abc9e35e4d0450f422fc03e2e53394e6a_html_abc9e35e4d0450f422fc03e2e53394e6a"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_abc9e35e4d0450f422fc03e2e53394e6a.html#abc9e35e4d0450f422fc03e2e53394e6a">nars.entity.TermLink.SELF</a></div><div class="ttdeci">static final short SELF</div><div class="ttdoc">At C, point to C; TaskLink only. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00040">TermLink.java:40</a></div></div>
<div class="ttc" id="namespacenars_html"><div class="ttname"><a href="../../d7/d81/namespacenars.html">nars</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_html"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink.html">nars.entity.TaskLink</a></div><div class="ttdoc">Reference to a Task. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00032">TaskLink.java:32</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_a60ac6941518e78c1f0049b90437b9053_html_a60ac6941518e78c1f0049b90437b9053"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_a60ac6941518e78c1f0049b90437b9053.html#a60ac6941518e78c1f0049b90437b9053">nars.entity.TaskLink.getTargetTask</a></div><div class="ttdeci">Task getTargetTask()</div><div class="ttdoc">Get the target Task. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00072">TaskLink.java:72</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7_html_a2356ada181399f3c6db60308dbb523f7"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">nars.entity.TermLink.index</a></div><div class="ttdeci">short[] index</div><div class="ttdoc">The index of the component in the component list of the compound, may have up to 4 levels...</div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00060">TermLink.java:60</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1_html_a320a24f2b4d275599b5a675f81af52d1"><div class="ttname"><a href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a320a24f2b4d275599b5a675f81af52d1.html#a320a24f2b4d275599b5a675f81af52d1">nars.storage.Memory.Parameters.TERM_LINK_RECORD_LENGTH</a></div><div class="ttdeci">static final int TERM_LINK_RECORD_LENGTH</div><div class="ttdoc">Remember recently used TermLink on a Task. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l01139">Memory.java:1139</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1Term_ad85f45a7858737445d5158801774ff5f_html_ad85f45a7858737445d5158801774ff5f"><div class="ttname"><a href="../../d8/db8/classnars_1_1language_1_1Term_ad85f45a7858737445d5158801774ff5f.html#ad85f45a7858737445d5158801774ff5f">nars.language.Term.equals</a></div><div class="ttdeci">boolean equals(Object that)</div><div class="ttdoc">Equal terms have identical name, though not necessarily the same reference. </div><div class="ttdef"><b>Definition:</b> <a href="../../d8/df2/Term_8java_source.html#l00094">Term.java:94</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1Term_html"><div class="ttname"><a href="../../d8/db8/classnars_1_1language_1_1Term.html">nars.language.Term</a></div><div class="ttdoc">Term is the basic component of Narsese, and the object of processing in NARS. </div><div class="ttdef"><b>Definition:</b> <a href="../../d8/df2/Term_8java_source.html#l00040">Term.java:40</a></div></div>
<div class="ttc" id="namespacenars_1_1language_html"><div class="ttname"><a href="../../d0/d72/namespacenars_1_1language.html">nars.language</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d0e/CompoundTerm_8java_source.html#l00021">CompoundTerm.java:21</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Item_ab5c9fbb171f325844966b496010acf60_html_ab5c9fbb171f325844966b496010acf60"><div class="ttname"><a href="../../d1/dd1/classnars_1_1entity_1_1Item_ab5c9fbb171f325844966b496010acf60.html#ab5c9fbb171f325844966b496010acf60">nars.entity.Item.getKey</a></div><div class="ttdeci">String getKey()</div><div class="ttdoc">Get the current key. </div><div class="ttdef"><b>Definition:</b> <a href="../../d9/de0/Item_8java_source.html#l00074">Item.java:74</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48_html_a83725fe12a973c0181d3143ed4622f48"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48.html#a83725fe12a973c0181d3143ed4622f48">nars.entity.TermLink.type</a></div><div class="ttdeci">short type</div><div class="ttdoc">The type of link, one of the above. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00058">TermLink.java:58</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1BudgetValue_html"><div class="ttname"><a href="../../db/d8e/classnars_1_1entity_1_1BudgetValue.html">nars.entity.BudgetValue</a></div><div class="ttdoc">A triple of priority (current), durability (decay), and quality (long-term average). </div><div class="ttdef"><b>Definition:</b> <a href="../../d8/d59/BudgetValue_8java_source.html#l00031">BudgetValue.java:31</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_ad19e927a3e2e339682081d8e462fe73b_html_ad19e927a3e2e339682081d8e462fe73b"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_ad19e927a3e2e339682081d8e462fe73b.html#ad19e927a3e2e339682081d8e462fe73b">nars.entity.TermLink.setKey</a></div><div class="ttdeci">void setKey()</div><div class="ttdoc">Set the key of the link. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00118">TermLink.java:118</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TaskLink_ae9f2d682898024ac0c358b50161b48d0_html_ae9f2d682898024ac0c358b50161b48d0"><div class="ttname"><a href="../../d9/d27/classnars_1_1entity_1_1TaskLink_ae9f2d682898024ac0c358b50161b48d0.html#ae9f2d682898024ac0c358b50161b48d0">nars.entity.TaskLink.toString</a></div><div class="ttdeci">String toString()</div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dce/TaskLink_8java_source.html#l00115">TaskLink.java:115</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_ed82ebcd34e530b246c6fd9032262140.html">aruntime</a></li><li class="navelem"><a class="el" href="../../dir_19496ddff8e6c0f2b6654287ecb1a472.html">src</a></li><li class="navelem"><a class="el" href="../../dir_db9c5934f797909f7296c2c2017f7fc9.html">main</a></li><li class="navelem"><a class="el" href="../../dir_6d74390eb6d6287951075e525bcb9bed.html">java</a></li><li class="navelem"><a class="el" href="../../dir_51a24984472456d47100350cd31f9a7c.html">nars</a></li><li class="navelem"><a class="el" href="../../dir_c3c9ea9f52870ae82b0fae20af0d9479.html">entity</a></li><li class="navelem"><a class="el" href="../../d3/dce/TaskLink_8java.html">TaskLink.java</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:58 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
